import 'package:flutter/material.dart';
import 'package:mahjong/page/dialog/Confirm.dart';
import 'package:mahjong/util/CustomNavigatorObserver.dart';

void _defaultOnTap() {}

class CommonDialog {
  static void showConfirmDialog(
      {Function confirm: _defaultOnTap,
      Function cancel: _defaultOnTap,
      String tips: ""}) {
    showDialog<Null>(
        context: CustomNavigatorObserver.getContext(),
        barrierDismissible: false,
        builder: (BuildContext context) {
          return Confirm(
            confirm: confirm,
            cancel: () {
              Navigator.of(CustomNavigatorObserver.getContext()).pop();
            },
            tips: tips,
          );
        });
  }
}
